<style>
    .student{
        padding: 10px;
        border: 1px solid #d2d6de;
        display: inline-block;
        margin-bottom: 5px;
    }
</style>

<div class="box" style="height: 60px; padding: 10px;">
    <span>选择科目：</span>
    <select class="form-control subject_type" style="width: 120px; display: inline;">
        @foreach($honor['subjects'] as $key=>$val)
            <option value="{{$val['class_subject_id']}}">{{$val['name']}}</option>
        @endforeach
    </select>
</div>

<div id="content">


</div>

<script>
    $(function () {
        var class_subject_id = 0;
        @if($honor['subjects'])
            class_subject_id = {{$honor['subjects'][0]['class_subject_id']}};
            $.ajax({
                type:"post",
                url:"/honor/getHonorData",
                data:{
                    honor_id:{{$honor['honor_id']}},
                    class_subject_id:class_subject_id,
                    _token:LA.token
                },
                success:function(r){
                    if (r){
                        $('#content').html(r);
                    }

                }
            })
        @endif

        $('.subject_type').change(function () {
           class_subject_id = $('.subject_type').val();
           $.ajax({
               type:"post",
               url:"/honor/getHonorData",
               data:{
                   honor_id:{{$honor['honor_id']}},
                   class_subject_id:class_subject_id,
                   _token:LA.token
               },
               success:function(r){
                   if (r){
                       $('#content').html(r);
                   }

               }
           })
        });




    });
</script>